package unq_ui.tp_robots_web_wicket.tools;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.IDataProvider;

import robots.domain.Robot;

@SuppressWarnings({ "serial", "rawtypes" })
public class TablaRobots extends DataView {

	@SuppressWarnings({ "unchecked" })
	protected TablaRobots(String id, IDataProvider dataProvider) {
		super(id, dataProvider);
	}

	@Override
	protected void populateItem(Item item) {}

	@SuppressWarnings({ "unused" })
	public void crearColumnasBasicasDeTabla(Item item){
		final Robot robot = (Robot) item.getModelObject();
		item.add(new Label("nombre", robot.getNombre()));
		item.add(new Label("poderTotal", robot.getPoderTotal()
				.toString()));
		item.add(new Label("deterioro", robot.getDanio().toString()));
		item.add(new Label("poderEfectivo", robot.getPoderEfectivo()
				.toString()));
	}

}
